package com.gitee.loyo.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 站点状态
 */
@Getter
@AllArgsConstructor
public enum StationStatus {
    UNKNOWN(0, "未知"), BUILDING(1, "建设中"), CLOSED(5, "关闭下线"), MAINTENANCE(6, "维护中"), OPENING(50, "正常使用");

    private int code;
    private String text;

    public static StationStatus valueOf(int code){
        switch (code){
            case 0: return UNKNOWN;
            case 1: return BUILDING;
            case 5: return CLOSED;
            case 6: return MAINTENANCE;
            case 50: return OPENING;
        }
        throw new UnsupportedOperationException("unknown code: " + code);
    }
}
